package cn.iocoder.yudao.module.diy.dal.mysql.config;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.diy.dal.dataobject.config.DiyConfigDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.diy.controller.admin.config.vo.*;

/**
 * 装修配置 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface DiyConfigMapper extends BaseMapperX<DiyConfigDO> {

    default PageResult<DiyConfigDO> selectPage(ConfigPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DiyConfigDO>()
                .eqIfPresent(DiyConfigDO::getAddonId, reqVO.getAddonId())
                .eqIfPresent(DiyConfigDO::getConfigKey, reqVO.getConfigKey())
                .eqIfPresent(DiyConfigDO::getConfigValue, reqVO.getConfigValue())
                .eqIfPresent(DiyConfigDO::getConfigStatus, reqVO.getConfigStatus())
                .betweenIfPresent(DiyConfigDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(DiyConfigDO::getId));
    }

}